<template>
  <a-config-provider :locale="locale === LanguageEnum.EN ? enUS : zhCN">
    <a-watermark :content="showWatermark ? defaultSettings.watermarkContent : ''">
      <router-view />
    </a-watermark>
  </a-config-provider>
</template>
<script setup>
import MicroApp from  '@/views/microApp/index.vue'
import { ref, watch, computed } from 'vue'
import enUS from 'ant-design-vue/es/locale/en_US'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import { useSettingsStore } from '@/store/index.js'
import { defaultSettings } from '@/settings.js'
import { LanguageEnum } from '@/enums/index.js'

dayjs.locale(LanguageEnum.ZH_CN)

const settingsStore = useSettingsStore()
const locale = ref(zhCN.locale)
const showWatermark = computed(() => settingsStore.showWatermark)

watch(locale, (val) => {
  dayjs.locale(val)
})
</script>

<style scoped></style>
